/* ============================================
   🎨 HarmonyPilot 现代化 UI 样式系统
   ============================================ */

/* ========== CSS变量定义 ========== */
:root {
  /* 主色调 - 科技紫蓝渐变 */
  --hp-primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --hp-primary-gradient-hover: linear-gradient(135deg, #5568d3 0%, #5f3d8a 100%);
  --hp-primary-solid: #667eea;
  --hp-primary-light: rgba(102, 126, 234, 0.1);
  
  /* 成功色 - 优雅绿 */
  --hp-success-gradient: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  --hp-success-solid: #11998e;
  --hp-success-light: rgba(17, 153, 142, 0.1);
  
  /* 警告色 - 活力橙 */
  --hp-warning-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --hp-warning-solid: #f5576c;
  --hp-warning-light: rgba(245, 87, 108, 0.1);
  
  /* 中性色 - 现代灰 */
  --hp-neutral-50: #f7f9fc;
  --hp-neutral-100: #f1f4f8;
  --hp-neutral-200: #e4e9f0;
  --hp-neutral-300: #d1d8e0;
  --hp-neutral-400: #a4b0be;
  --hp-neutral-500: #6c7a89;
  --hp-neutral-600: #57606f;
  --hp-neutral-700: #2f3542;
  --hp-neutral-800: #1e2330;
  --hp-neutral-900: #13151d;
  
  /* 阴影系统 - 分层深度 */
  --hp-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --hp-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --hp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --hp-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --hp-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* 彩色阴影 */
  --hp-shadow-primary: 0 8px 25px 0 rgba(102, 126, 234, 0.35);
  --hp-shadow-success: 0 8px 25px 0 rgba(17, 153, 142, 0.35);
  --hp-shadow-warning: 0 8px 25px 0 rgba(245, 87, 108, 0.35);
  
  /* 毛玻璃效果 */
  --hp-glass-bg: rgba(255, 255, 255, 0.95);
  --hp-glass-blur: blur(20px) saturate(180%);
  --hp-glass-border: rgba(255, 255, 255, 0.18);
  
  /* 圆角 */
  --hp-radius-sm: 8px;
  --hp-radius-md: 12px;
  --hp-radius-lg: 16px;
  --hp-radius-xl: 20px;
  --hp-radius-full: 9999px;
  
  /* 过渡动画 */
  --hp-transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --hp-transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --hp-transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* 间距 */
  --hp-space-xs: 4px;
  --hp-space-sm: 8px;
  --hp-space-md: 12px;
  --hp-space-lg: 16px;
  --hp-space-xl: 24px;
  --hp-space-2xl: 32px;
}

/* 暗黑模式变量 */
[data-theme="dark"] {
  --hp-neutral-50: #13151d;
  --hp-neutral-100: #1e2330;
  --hp-neutral-200: #2f3542;
  --hp-neutral-300: #57606f;
  --hp-neutral-400: #6c7a89;
  --hp-neutral-500: #a4b0be;
  --hp-neutral-600: #d1d8e0;
  --hp-neutral-700: #e4e9f0;
  --hp-neutral-800: #f1f4f8;
  --hp-neutral-900: #f7f9fc;
  
  --hp-glass-bg: rgba(30, 35, 48, 0.95);
  --hp-glass-border: rgba(255, 255, 255, 0.08);
  
  --hp-shadow-primary: 0 8px 25px 0 rgba(102, 126, 234, 0.20);
  --hp-shadow-success: 0 8px 25px 0 rgba(17, 153, 142, 0.20);
  --hp-shadow-warning: 0 8px 25px 0 rgba(245, 87, 108, 0.20);
}

/* ========== 现代化按钮系统 ========== */
.hp-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hp-space-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--hp-radius-md);
  border: none;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: var(--hp-transition-base);
  overflow: hidden;
}

.hp-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.hp-button:active::before {
  width: 300px;
  height: 300px;
}

/* 主要按钮 - 渐变紫蓝 */
.hp-button-primary {
  background: var(--hp-primary-gradient);
  color: white;
  box-shadow: var(--hp-shadow-md), var(--hp-shadow-primary);
}

.hp-button-primary:hover {
  background: var(--hp-primary-gradient-hover);
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-lg), 0 10px 30px 0 rgba(102, 126, 234, 0.45);
}

.hp-button-primary:active {
  transform: translateY(0);
}

/* 成功按钮 - 渐变绿 */
.hp-button-success {
  background: var(--hp-success-gradient);
  color: white;
  box-shadow: var(--hp-shadow-md), var(--hp-shadow-success);
}

.hp-button-success:hover {
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-lg), 0 10px 30px 0 rgba(17, 153, 142, 0.45);
}

/* 警告按钮 - 渐变橙 */
.hp-button-warning {
  background: var(--hp-warning-gradient);
  color: white;
  box-shadow: var(--hp-shadow-md), var(--hp-shadow-warning);
}

.hp-button-warning:hover {
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-lg), 0 10px 30px 0 rgba(245, 87, 108, 0.45);
}

/* 次要按钮 - 描边 */
.hp-button-secondary {
  background: var(--hp-glass-bg);
  color: var(--hp-primary-solid);
  border: 2px solid var(--hp-primary-solid);
  backdrop-filter: var(--hp-glass-blur);
  box-shadow: var(--hp-shadow-sm);
}

.hp-button-secondary:hover {
  background: var(--hp-primary-light);
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-md);
}

/* 幽灵按钮 - 透明 */
.hp-button-ghost {
  background: transparent;
  color: var(--hp-neutral-700);
}

.hp-button-ghost:hover {
  background: var(--hp-neutral-100);
}

/* 清屏按钮 - 默认显眼设计 */
.hp-button-clear {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: var(--hp-shadow-md), var(--hp-shadow-primary);
  font-weight: 500;
}

.hp-button-clear:hover {
  background: linear-gradient(135deg, #5568d3 0%, #5f3d8a 100%);
  transform: translateY(-1px);
  box-shadow: var(--hp-shadow-lg), 0 10px 30px 0 rgba(102, 126, 234, 0.4);
}

/* 按钮尺寸 */
.hp-button-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--hp-radius-sm);
}

.hp-button-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--hp-radius-lg);
}

/* 按钮禁用状态 */
.hp-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 按钮加载状态 */
.hp-button-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* ========== 消息气泡系统 ========== */
.hp-message-bubble {
  position: relative;
  background: var(--hp-glass-bg);
  backdrop-filter: var(--hp-glass-blur);
  border-radius: var(--hp-radius-lg);
  border: 1px solid var(--hp-glass-border);
  box-shadow: var(--hp-shadow-lg);
  padding: var(--hp-space-lg);
  margin-bottom: var(--hp-space-lg);
  transition: var(--hp-transition-base);
}

.hp-message-bubble:hover {
  box-shadow: var(--hp-shadow-xl);
  transform: translateY(-2px);
}

/* 用户消息气泡 */
.hp-message-bubble-user {
  background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
  border-left: 4px solid var(--hp-primary-solid);
}

/* AI消息气泡 */
.hp-message-bubble-ai {
  background: var(--hp-glass-bg);
  border-left: 4px solid var(--hp-success-solid);
}

/* ========== 图标样式 ========== */
.hp-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hp-icon-sm {
  width: 16px;
  height: 16px;
}

.hp-icon-lg {
  width: 24px;
  height: 24px;
}

/* ========== 卡片系统 ========== */
.hp-card {
  background: var(--hp-glass-bg);
  backdrop-filter: var(--hp-glass-blur);
  border-radius: var(--hp-radius-lg);
  border: 1px solid var(--hp-glass-border);
  box-shadow: var(--hp-shadow-md);
  padding: var(--hp-space-xl);
  transition: var(--hp-transition-base);
}

.hp-card:hover {
  box-shadow: var(--hp-shadow-lg);
  transform: translateY(-4px);
}

/* ========== 加载动画 ========== */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.hp-loading-skeleton {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(
    90deg,
    var(--hp-neutral-100) 0px,
    var(--hp-neutral-200) 40px,
    var(--hp-neutral-100) 80px
  );
  background-size: 936px 100%;
  border-radius: var(--hp-radius-md);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hp-spin {
  animation: spin 1s linear infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.hp-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.hp-bounce {
  animation: bounce 1s infinite;
}

/* ========== 渐入动画 ========== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hp-fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ========== 滑入动画 ========== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hp-slide-up {
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== 缩放动画 ========== */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.hp-scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========== 输入框系统 ========== */
.hp-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--hp-neutral-800);
  background: var(--hp-glass-bg);
  backdrop-filter: var(--hp-glass-blur);
  border: 2px solid var(--hp-neutral-200);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-sm);
  transition: var(--hp-transition-base);
  outline: none;
}

.hp-input:hover {
  border-color: var(--hp-neutral-300);
}

.hp-input:focus {
  border-color: var(--hp-primary-solid);
  box-shadow: var(--hp-shadow-md), 0 0 0 4px var(--hp-primary-light);
}

/* ========== 徽章系统 ========== */
.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-xs);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--hp-radius-full);
  white-space: nowrap;
}

.hp-badge-primary {
  background: var(--hp-primary-light);
  color: var(--hp-primary-solid);
}

.hp-badge-success {
  background: var(--hp-success-light);
  color: var(--hp-success-solid);
}

.hp-badge-warning {
  background: var(--hp-warning-light);
  color: var(--hp-warning-solid);
}

/* ========== 分隔线 ========== */
.hp-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--hp-neutral-200) 50%,
    transparent
  );
  margin: var(--hp-space-xl) 0;
}

/* ========== 工具提示 ========== */
.hp-tooltip {
  position: absolute;
  z-index: 1000;
  padding: 6px 12px;
  font-size: 12px;
  color: white;
  background: var(--hp-neutral-800);
  border-radius: var(--hp-radius-sm);
  box-shadow: var(--hp-shadow-lg);
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: var(--hp-transition-fast);
}

.hp-tooltip.show {
  opacity: 1;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
  .hp-button {
    padding: 8px 16px;
    font-size: 13px;
  }
  
  .hp-card {
    padding: var(--hp-space-lg);
  }
  
  .hp-message-bubble {
    padding: var(--hp-space-md);
  }
}

